
var request = require("request");

module.exports = (param, isBody = true) => {
  return new Promise((resolve, reject) => {
    request(param, function (error, response, body) {
      if (error) {
        reject(error);
        return;
      }
      resolve(isBody ? body : response);
    })
  })
};

